.class public Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;
.super Ljava/lang/Object;
.source "BbsInfoParser.java"


# instance fields
.field private final FGID:Ljava/lang/String;

.field private final FIRSTCHAR:Ljava/lang/String;

.field private final FORUMAPP:Ljava/lang/String;

.field private final FORUMNAME:Ljava/lang/String;

.field private final GROUPCATEGORY:Ljava/lang/String;

.field private final LASTPOST:Ljava/lang/String;

.field private final LASTPOSTER:Ljava/lang/String;

.field private final LASTPOSTERID:Ljava/lang/String;

.field private final LOGO:Ljava/lang/String;

.field private final MEMBERCOUNT:Ljava/lang/String;

.field private final POSTDATETIME:Ljava/lang/String;

.field private final POSTER:Ljava/lang/String;

.field private final POSTERID:Ljava/lang/String;

.field private final POSTS:Ljava/lang/String;

.field private TAG:Ljava/lang/String;

.field private final TID:Ljava/lang/String;

.field private final TITLE:Ljava/lang/String;

.field private final TODAYPOSTS:Ljava/lang/String;

.field private final TOPIC:Ljava/lang/String;

.field private bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

.field private topicList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/bbs/Object/Topic;",
            ">;"
        }
    .end annotation
.end field

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 53
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 21
    const-string v0, "todayposts"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->TODAYPOSTS:Ljava/lang/String;

    .line 22
    const-string v0, "posts"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->POSTS:Ljava/lang/String;

    .line 23
    const-string v0, "MemberCount"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->MEMBERCOUNT:Ljava/lang/String;

    .line 25
    const-string v0, "topic"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->TOPIC:Ljava/lang/String;

    .line 26
    const-string v0, "GroupCategory"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->GROUPCATEGORY:Ljava/lang/String;

    .line 27
    const-string v0, "FirstChar"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->FIRSTCHAR:Ljava/lang/String;

    .line 29
    const-string v0, "FGid"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->FGID:Ljava/lang/String;

    .line 30
    const-string v0, "ForumApp"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->FORUMAPP:Ljava/lang/String;

    .line 31
    const-string v0, "ForumName"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->FORUMNAME:Ljava/lang/String;

    .line 33
    const-string v0, "Lastpost"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->LASTPOST:Ljava/lang/String;

    .line 34
    const-string v0, "Lastposter"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->LASTPOSTER:Ljava/lang/String;

    .line 35
    const-string v0, "Lastposterid"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->LASTPOSTERID:Ljava/lang/String;

    .line 37
    const-string v0, "Postdatetime"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->POSTDATETIME:Ljava/lang/String;

    .line 38
    const-string v0, "Poster"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->POSTER:Ljava/lang/String;

    .line 39
    const-string v0, "Posterid"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->POSTERID:Ljava/lang/String;

    .line 41
    const-string v0, "tid"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->TID:Ljava/lang/String;

    .line 42
    const-string v0, "Title"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->TITLE:Ljava/lang/String;

    .line 43
    const-string v0, "logo"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->LOGO:Ljava/lang/String;

    .line 49
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->url:Ljava/lang/String;

    .line 51
    const-string v0, "BbsInfoParser"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->TAG:Ljava/lang/String;

    .line 54
    iput-object p1, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->url:Ljava/lang/String;

    .line 55
    return-void
.end method


# virtual methods
.method public Paser2Object()V
    .locals 10

    .prologue
    const/4 v9, 0x0

    .line 58
    new-instance v7, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    invoke-direct {v7}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;-><init>()V

    iput-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    .line 60
    new-instance v7, Ljava/util/ArrayList;

    invoke-direct {v7}, Ljava/util/ArrayList;-><init>()V

    iput-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->topicList:Ljava/util/ArrayList;

    .line 62
    :try_start_0
    iget-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->url:Ljava/lang/String;

    invoke-static {v7}, Lcom/bitauto/autoeasy/tool/Caller;->doGet(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 63
    .local v5, str:Ljava/lang/String;
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4, v5}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 65
    .local v4, jObject:Lorg/json/JSONObject;
    const-string v7, "bbsinfo"

    invoke-virtual {v4, v7}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v2

    .line 66
    .local v2, jArray:Lorg/json/JSONArray;
    if-eqz v2, :cond_0

    .line 67
    const/4 v7, 0x0

    invoke-virtual {v2, v7}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v7

    invoke-virtual {p0, v7}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->createBbsInfo(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    move-result-object v7

    iput-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    .line 68
    iget-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    if-eqz v7, :cond_0

    .line 69
    const-string v7, "topics"

    invoke-virtual {v4, v7}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v7

    const-string v8, "topic"

    invoke-virtual {v7, v8}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    .line 70
    .local v3, jArray2:Lorg/json/JSONArray;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v7

    if-lt v1, v7, :cond_1

    .line 91
    .end local v1           #i:I
    .end local v2           #jArray:Lorg/json/JSONArray;
    .end local v3           #jArray2:Lorg/json/JSONArray;
    .end local v4           #jObject:Lorg/json/JSONObject;
    .end local v5           #str:Ljava/lang/String;
    :cond_0
    :goto_1
    return-void

    .line 71
    .restart local v1       #i:I
    .restart local v2       #jArray:Lorg/json/JSONArray;
    .restart local v3       #jArray2:Lorg/json/JSONArray;
    .restart local v4       #jObject:Lorg/json/JSONObject;
    .restart local v5       #str:Ljava/lang/String;
    :cond_1
    invoke-virtual {v3, v1}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v7

    invoke-virtual {p0, v7}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->createTopic(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/bbs/Object/Topic;

    move-result-object v6

    .line 72
    .local v6, topic:Lcom/bitauto/autoeasy/bbs/Object/Topic;
    if-eqz v6, :cond_2

    .line 73
    iget-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->topicList:Ljava/util/ArrayList;

    invoke-virtual {v7, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 75
    :cond_2
    iget-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->topicList:Ljava/util/ArrayList;

    if-eqz v7, :cond_3

    .line 76
    iget-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    iget-object v8, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->topicList:Ljava/util/ArrayList;

    invoke-virtual {v7, v8}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setTopicList(Ljava/util/ArrayList;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_0 .. :try_end_0} :catch_1

    .line 70
    :cond_3
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 83
    .end local v1           #i:I
    .end local v2           #jArray:Lorg/json/JSONArray;
    .end local v3           #jArray2:Lorg/json/JSONArray;
    .end local v4           #jObject:Lorg/json/JSONObject;
    .end local v5           #str:Ljava/lang/String;
    .end local v6           #topic:Lcom/bitauto/autoeasy/bbs/Object/Topic;
    :catch_0
    move-exception v7

    move-object v0, v7

    .line 84
    .local v0, e:Ljava/lang/Exception;
    iput-object v9, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    .line 85
    iget-object v7, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->TAG:Ljava/lang/String;

    new-instance v8, Ljava/lang/StringBuilder;

    const-string v9, "error :"

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 86
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1

    .line 87
    .end local v0           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v7

    move-object v0, v7

    .line 88
    .local v0, e:Lcom/bitauto/autoeasy/tool/WSError;
    iput-object v9, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    .line 89
    invoke-virtual {v0}, Lcom/bitauto/autoeasy/tool/WSError;->printStackTrace()V

    goto :goto_1
.end method

.method public createBbsInfo(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;
    .locals 5
    .parameter "obj"

    .prologue
    .line 98
    new-instance v0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    invoke-direct {v0}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;-><init>()V

    .line 100
    .local v0, bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;
    :try_start_0
    const-string v2, "FGid"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setFGid(Ljava/lang/String;)V

    .line 101
    const-string v2, "FirstChar"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setFirstChar(Ljava/lang/String;)V

    .line 102
    const-string v2, "ForumApp"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setForumApp(Ljava/lang/String;)V

    .line 103
    const-string v2, "ForumName"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setForumName(Ljava/lang/String;)V

    .line 104
    const-string v2, "GroupCategory"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setGroupCategory(Ljava/lang/String;)V

    .line 105
    const-string v2, "MemberCount"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setMemberCount(Ljava/lang/String;)V

    .line 106
    const-string v2, "posts"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setPosts(Ljava/lang/String;)V

    .line 107
    const-string v2, "todayposts"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setTodayposts(Ljava/lang/String;)V

    .line 108
    const-string v2, "topic"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setTopic(Ljava/lang/String;)V

    .line 109
    const-string v2, "logo"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setLogo(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v2, v0

    .line 114
    :goto_0
    return-object v2

    .line 111
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 112
    .local v1, e:Lorg/json/JSONException;
    const-string v2, "BbsInfoParser"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "error :"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 113
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    .line 114
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public createTopic(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/bbs/Object/Topic;
    .locals 5
    .parameter "obj"

    .prologue
    .line 119
    new-instance v1, Lcom/bitauto/autoeasy/bbs/Object/Topic;

    invoke-direct {v1}, Lcom/bitauto/autoeasy/bbs/Object/Topic;-><init>()V

    .line 121
    .local v1, topic:Lcom/bitauto/autoeasy/bbs/Object/Topic;
    :try_start_0
    const-string v2, "Lastpost"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setLastpost(Ljava/lang/String;)V

    .line 122
    const-string v2, "Lastposter"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setLastposter(Ljava/lang/String;)V

    .line 123
    const-string v2, "Lastposterid"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setLastposterid(Ljava/lang/String;)V

    .line 124
    const-string v2, "Postdatetime"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setPostdatetime(Ljava/lang/String;)V

    .line 125
    const-string v2, "Poster"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setPoster(Ljava/lang/String;)V

    .line 126
    const-string v2, "Posterid"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setPosterid(Ljava/lang/String;)V

    .line 127
    const-string v2, "tid"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setTid(Ljava/lang/String;)V

    .line 128
    const-string v2, "Title"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/bbs/Object/Topic;->setTitle(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v2, v1

    .line 133
    :goto_0
    return-object v2

    .line 130
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 131
    .local v0, e:Lorg/json/JSONException;
    const-string v2, "BbsInfoParser"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "error :"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 132
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    .line 133
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public getBbsInfo()Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;
    .locals 1

    .prologue
    .line 94
    iget-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfoParser;->bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    return-object v0
.end method
